#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int arr[10] = { 0 };
	int n = 0;
	int i = 0;
	scanf("%d", &n);
	while (n > 9)
	{
		arr[i++] = n % 10;
		n = n / 10;
	}
	if (n <= 9)
	{
		
		arr[i] = n;
	}
	for (int j = i;j >=0;j--)
	{
		printf("%d ", arr[j]);
	}
	return 0;
}
